
# Recording all WinPoint transactions
class PointHistory < ActiveRecord::Base
after_create :add_user_invited_num
belongs_to :user
# Add invited friends count
def add_user_invited_num
   if self.action == "invite friend" and self.user
     self.user.invitation_sent_number = self.user.invitation_sent_number.to_i + 1
     self.user.save
   end
end
end
